package com.zhangyujun.study.controller;

import com.zhangyujun.study.service.ChatAssistant;
import dev.langchain4j.model.chat.ChatModel;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhangyujun
 * @Description: TODO
 * @DateTime: 2025/7/27 19:35
 **/
@RestController
@RequestMapping("/lc4j")
public class DeclarativeAIServiceController {

    @Resource
    private ChatAssistant chatAssistant;
    @GetMapping("/chat")
    public String chat(@RequestParam(value = "prompt", defaultValue = "你是谁") String prompt) {
        return chatAssistant.chat(prompt);
    }
}
